﻿<%@ Page Title="" Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" CodeFile="Feedback.aspx.cs" Inherits="Feedback" Async="true" Culture="auto" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        $(function () {
            //品牌目录
            $(".categories_inner .column").each(function () {
                if ($(this).find("div").length == 0) {
                    $(this).remove();
                }
            });
            updateCategories();
            $(".categories_collapse").live("click", function () {
                var categories = $(".categories");
                var iconDown = '<%=ResolveUrl("~/images/categories_collapse_down.jpg") %>';
                var iconUp = '<%=ResolveUrl("~/images/categories_collapse_up.jpg") %>';

                if (categories.height() != 16) {
                    //                    categories.empty().animate({ height: 16 }).append('<a class="categories_collapse btn" style="bottom:0;"><img src="' + icon + '" /></a>');
                    categories.animate({ height: 16 }, function () {
                        $(this).find('.categories_collapse').find('img').attr({ src: iconDown });
                    });
                }
                else {
                    //                    if (Brands.UpdateBrands()) {
                    //                        __doPostBack('UpdatePanel1', '');
                    //                    }
                    categories.animate({ height: 140 }, function () {
                        $(this).find('.categories_collapse').find('img').attr({ src: iconUp });
                    });
                }
            });


            //发送邮件
            $("#btnsend").click(function () {
                if (formvalidate()) {
                    var mailArray = [];
                    mailArray.push({ "from": $("#txtFrom").val(), "to": $("#to").val(), "qq": $("#txtQQ").val(), "name": $.utility.encode($("#txtName").val()), "desc": $.utility.encode($("#txtContent").val().replace(new RegExp("\n", "g"), "<br/>")) });
                    var mail = JSON.stringify(mailArray[0]);
                    var request = $.ajax({
                        url: '<%=ResolveUrl("~/handlers/MailHandler.ashx") %>',
                        type: "POST",
                        data: { maildata: mail },
                        dataType: "json"
                    });

                    request.done(function (msg) {
                        if (msg.Status.toLowerCase() == "true") {
                            alert("发送成功!");
                        }
                    });

                    request.fail(function (jqXHR, textStatus) {
                        alert("发送失败。请重试...");
                    });
                }
            });
        });

        function formvalidate() {
            var result = true;
            $(".error_wrapper ul").empty();
            $(".required").each(function () {
                if ($.trim($(this).val()) == "") {
                    $(".error_wrapper ul").append("<li>" + $(this).attr("title") + "</li>");
                    result = false;
                }
            });

            if (!result) $(".error_wrapper").fadeIn();
            else $(".error_wrapper ul").empty();

            return result;
        }


        //Updatepanel1 更新时重新调用carouFredSel jQuery插件
        function updateCategories() {
            $(".categories_inner").carouFredSel({
                width: 970,
                items: { visible: 5,
                    width: 190,
                    height: 140
                },
                auto: { pauseOnHover: "resume", duration: 700 },
                prev: { button: $(".categories_prev") },
                next: { button: $(".categories_next") }
            });
        }

        //圆角
        addEvent(window, 'load', initCorners);

        function initCorners() {
            var tag_settings = {
                tl: { radius: 10 },
                tr: { radius: 10 },
                bl: { radius: 10 },
                br: { radius: 10 },
                antiAlias: true
            };

            curvyCorners(tag_settings, ".input_wrapper");
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" AsyncPostBackTimeout="36000">
    </asp:ScriptManager>
    <!--品牌分类-->
    <div class="categories block">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <ul class="categories_inner">
                    <li class="column">
                        <script type="text/javascript">
                            //                            Sys.Application.add_load(updateCategories);
                        </script>
                        <asp:Repeater ID="rptCategories" runat="server" OnItemCommand="rptCategories_ItemCommand">
                            <ItemTemplate>
                                <div>
                                    <asp:LinkButton ID="lbtnCategory" runat="server" CommandName="CATEGORY_CHANGE" CommandArgument='<%#Eval("BrandID").ToString()%>' Text='<%#HttpUtility.HtmlEncode(Eval("BrandName").ToString())%>'></asp:LinkButton></div>
                                <%# ((Container.ItemIndex+1) % 3 == 0 )? "</li><li class='column'>" :""%>
                            </ItemTemplate>
                        </asp:Repeater>
                    </li>
                </ul>
            </ContentTemplate>
        </asp:UpdatePanel>
        <a class="categories_prev btn"></a><a class="categories_next btn"></a><a class="categories_collapse btn">
            <img src='<%=ResolveUrl("~/images/categories_collapse_up.jpg") %>' />
        </a>
    </div>
    <div class="clearfix" style="margin-top:5px;">
        <div class="article_left">
            <div class="block b_202020 padding3 tc">
                <a href="http://weibo.com/seduceyy" target="_blank"><img src="images/weibo_sina2.jpg" /></a>
                <div class="article_categories block margin5_tb" style="padding-bottom:20px;">
                    <div class="article_category">
                        <a>Se'Duce 客户建议</a>
                    </div>
                </div>
            </div>
            <div class="block margin5_tb">
            <asp:Repeater ID="rptAds" runat="server">
                <ItemTemplate>
                    <div class="rightbar_innerblock">
                        <a href='<%#ResolveUrl(Eval("Url").ToString()) %>' target="_blank">
                            <img src='<%#ResolveUrl(Eval("Image").ToString()) %>' width="100%" border="0" alt='<%#Eval("AdName").ToString() %>' /></a>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            </div>
        </div>
        <div class="article_right block b_202020 padding3">
            <div class="article_content block b_202020">
                <h2><asp:Localize ID="Localize1" Text='<%$ Resources: ResourceGlobal, Feedback_Title  %>' runat="server"></asp:Localize></h2>
                <table cellpadding="0" cellspacing="0" class="table" style="margin:20px;">
                    <tr>
                        <td class="field"><%= Resources.ResourceGlobal.Feedback_To  %>:</td>
                        <td><span id="to">info@seduceyy.com</span></td>
                    </tr>
                    <tr>
                        <td class="field"><%= Resources.ResourceGlobal.Feedback_From  %>:</td>
                        <td>
                            <div class="input_wrapper">
                                <input id="txtFrom" type="text" style="width:300px;" class="required" title='<%= Resources.ResourceGlobal.Feedback_From  %>' />
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="field">QQ/MSN:</td>
                        <td>
                            <div class="input_wrapper">
                                <input id="txtQQ" type="text" style="width:300px;" title='' />
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="field"><%= Resources.ResourceGlobal.Feedback_Name  %>:</td>
                        <td>
                            <div class="input_wrapper">
                                <input id="txtName" type="text" style="width:300px;" class="required" title='<%= Resources.ResourceGlobal.Feedback_Name  %>' />
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="field" style=" vertical-align:top;"><%= Resources.ResourceGlobal.Feedback_Content  %>:</td>
                        <td><textarea id="txtContent" style="width:530px;height:200px;" class="required" title='<%= Resources.ResourceGlobal.Feedback_Content  %>'></textarea></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>
                            <div class="error_wrapper" style="width:520px;"><p><b><asp:Localize ID="Localize9" Text='<%$ Resources: ResourceGlobal, Note_Required  %>' runat="server"></asp:Localize>：</b></p><ul></ul></div>
                            <a id="btnsend" class="buttons"><b></b><span><asp:Localize ID="Localize8" Text='<%$ Resources: ResourceGlobal, Feedback_Send  %>' runat="server"></asp:Localize></span><em></em></a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</asp:Content>

